#ifndef CONTROLLER_H
#define CONTROLLER_H

#include <vector>
#include <time.h>
//#include "svmCommon.h" 

using std::vector;

class Controller {
public:
	Controller(float initialGap, SelectionHeuristic currentMethodIn, int samplingIntervalIn, int problemSize);
	void addIteration(float gap);
	void print();
	SelectionHeuristic getMethod();
private:
	bool adaptive;
	int samplingInterval;
	vector<float> progress;
	vector<int> method;
	SelectionHeuristic currentMethod;
	vector<float> rates;
	int timeSinceInspection;
	int inspectionPeriod;
	int beginningOfEpoch;
	int middleOfEpoch;
	int currentInspectionPhase;
	float filter(int begin, int end);
	float findRate(clock_t beginTime,clock_t endTime,int beginning, int end);
	clock_t start;
	clock_t mid;
	clock_t finish;
};

#endif